package com.spring.demo1;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.core.Ordered;
/**
 * BeanPostProcessor 接口定义回掉方法，可以通过实现该方法来提供自己的实例化逻辑
 */
public class InitHelloWorld2 implements BeanPostProcessor,Ordered {

	@Override
	public Object postProcessAfterInitialization(Object arg0, String arg1) throws BeansException {
		System.out.println("AfterInitialization2 : " + arg1);
		return arg0; // you can return any other object as well
	}

	@Override
	public Object postProcessBeforeInitialization(Object arg0, String arg1)	throws BeansException {
		System.out.println("BeforeInitialization2 : " + arg1);
		return arg0; // you can return any other object as well
	}

	@Override
	public int getOrder() {
		// TODO Auto-generated method stub
		return 1;
	}

}
